<?php if (!defined('MAX_ON')){echo "<h1>ACCESS DENIED</h1>You cannot access this file directly.";exit();} ?>
<?php if ($template_hook=='start'){ ?>
<?php }elseif ($template_hook=='1'){ ?>
	<table class="forum-board-forum-head" cellpadding="0" cellspacing="0">
	
		<tr><td class="forum-topic-subject"><?php echo $lang_admin['admin_title_blocks']; ?></td></tr>
		<tr><td class="forum-index-topic-sub"> </td></tr>
	
	</table>
	
	<table class="forum-index" cellpadding="0" cellspacing="0">
	
		<tr><td class="forum-index-stats-header forum-index-top"><?php echo $lang_admin['admin_settings']; ?></td></tr>
		
		<tr>
			<td class="forum-jump-content" style="width: 100%;">
			
				<form method="post" action="<?php echo $max_domain; ?>/index.php?page=admin&act=blocks">
				
				<div class="f_right" style="width: 30%">
					<strong><?php echo $lang_admin['admin_des_option']; ?></strong>
				</div>
				<div class="f_right" style="width: 70%">
				
					<?php $checked = ($menu_block == 1) ? 'checked' : ''; ?>
					
					<input type="checkbox" class="checkbox" name="menu_block" value="1" <?php echo $checked; ?> />
					
				</div>

				<br /><br /><br />
				
				<div class="f_right" style="width: 100%; text-align: center;"><input type="submit" class="img-submit" value="<?php echo $lang['button_submit']; ?>" /></div>
				
				</form>
			
			</td>
		</tr>
		
		<tr>
			<td class="forum-index-stats-header forum-index-top">
			
				<span style="float: <?php echo $lang['header_right']; ?>"><?php echo $lang_admin['admin_titla_loop']; ?></span>
				
				<span style="float: <?php echo $lang['header_left']; ?>;">
				
					<a href="<?php echo max_link('index.php?page=admin&act=blocks&sub=add_block', 'admin/blocks/add_block'); ?>"><?php echo $lang_admin['admin_add_block']; ?></a>
					
				</span>
			
			</td>
		</tr>
		
		<tr>
			<td class="forum-jump-content" style="width: 100%;">
			
				<table class="forum-index" cellpadding="0" cellspacing="0">
<?php }elseif ($template_hook=='2'){ ?>
					<tr style="background-color: <?php echo $bgcolor; ?>">
						<td style="border-bottom: 1px solid grey; padding: 5px; width: 25%">
							<a href="<?php echo max_link('index.php?page=admin&act=blocks&sub=edit_block&id=' . $row['id'], 'admin/blocks/edit_block/' . $row['id']); ?>"><?php echo $row['title']; ?></a>
						</td>
						<td style="border-bottom: 1px solid grey; padding: 5px"><?php echo $b_type; ?></td>
						<td style="border-bottom: 1px solid grey; padding: 5px; width: 5%">
							
							<a href="<?php echo max_link('index.php?page=admin&act=blocks&sub=delete_block&id=' . $row['id'], 'admin/blocks/delete_block/' . $row['id']); ?>" onclick="javascript:return confirm('<?php echo $lang['topic_remove']; ?>')">
								<img src="<?php echo $delete_icon_img; ?>" alt="<?php echo $lang_admin['custom_delete']; ?>" />
							</a>
						
						</td>
					</tr>
<?php }elseif ($template_hook=='3'){ ?>
				</table>
			
			</td>
		</tr>
		
	</table>
	
	<table class="forum-index-forum-footer" cellpadding="0" cellspacing="0">
		<tr><td class="forum-index-forum-footer-contents"> </td></tr>
	</table>
<?php }elseif ($template_hook=='4'){ ?>
	<table class="forum-board-forum-head" cellpadding="0" cellspacing="0">
	
		<tr><td class="forum-topic-subject"><?php echo $lang_admin['admin_add_block']; ?></td></tr>
		<tr><td class="forum-index-topic-sub"> </td></tr>
	
	</table>
	
	<table class="forum-index" cellpadding="0" cellspacing="0">
	
		<tr><td class="forum-index-stats-header forum-index-top"><?php echo $lang_admin['admin_details_block']; ?></td></tr>
		
		<tr>
			<td class="forum-jump-content" style="width: 100%;">
			
				<form method="post" action="<?php echo $max_domain; ?>/index.php?page=admin&act=blocks&sub=add_block">
			
				<div class="f_right" style="width: 30%"><?php echo $lang_admin['admin_block_name']; ?></div>
				<div class="f_right" style="width: 70%"><input type="text" name="title" /></div>
				
				<br /><br />
				
				<div class="f_right" style="width: 30%"><?php echo $lang_admin['admin_contant']; ?></div>
				<div class="f_right" style="width: 70%"><textarea name="contant" dir="ltr" cols="60" rows="10"></textarea></div>
				
				<br /><br />
				
				<div class="f_right" style="width: 30%"><?php echo $lang_admin['admin_file_php']; ?></div>
				<div class="f_right" style="width: 70%">
					<select name="block_file">
						<option value="0"><?php echo $lang_admin['admin_code_html']; ?></option>
<?php }elseif ($template_hook=='6'){ ?>
						<option value="<?php echo $block_file_name; ?>"><?php echo $block_file_name; ?></option>
<?php }elseif ($template_hook=='7'){ ?>
					</select>
				</div>
				
				<br /><br />
				
				<div class="f_right" style="width: 30%">&nbsp;</div>
				<div class="f_right" style="width: 70%"><br /><input type="submit" class="img-submit" value="<?php echo $lang['button_submit']; ?>" /></div>
				
				</form>
			
			</td>
		</tr>
		
	</table>

	<table class="forum-index-forum-footer" cellpadding="0" cellspacing="0">
		<tr><td class="forum-index-forum-footer-contents"> </td></tr>
	</table>
<?php }elseif ($template_hook=='5'){ ?>
	<table class="forum-board-forum-head" cellpadding="0" cellspacing="0">
	
		<tr><td class="forum-topic-subject"><?php echo $lang_admin['admin_editing'] . $info['title']; ?></td></tr>
		<tr><td class="forum-index-topic-sub"> </td></tr>
	
	</table>
	
	<table class="forum-index" cellpadding="0" cellspacing="0">
	
		<tr><td class="forum-index-stats-header forum-index-top"><?php echo $lang_admin['admin_details_block']; ?></td></tr>
		
		<tr>
			<td class="forum-jump-content" style="width: 100%;">

				<form method="post" action="<?php echo $max_domain; ?>/index.php?page=admin&act=blocks&sub=edit_block">
				
				<input type="hidden" name="id" value="<?php echo $info['id']; ?>" />
			
				<div class="f_right" style="width: 30%"><?php echo $lang_admin['admin_block_name']; ?></div>
				<div class="f_right" style="width: 70%"><input type="text" value="<?php echo $info['title']; ?>" name="title" /></div>
				
				<br /><br />
				
				<div class="f_right" style="width: 30%"><?php echo $lang_admin['admin_contant']; ?></div>
				<div class="f_right" style="width: 70%"><textarea name="contant" dir="ltr" cols="60" rows="10"><?php echo $info['contant']; ?></textarea></div>
				
				<br /><br />
				
				<div class="f_right" style="width: 30%"><?php echo $lang_admin['admin_file_php']; ?></div>
				<div class="f_right" style="width: 70%">
					<select name="block_file">
						<option value="0"><?php echo $lang_admin['admin_code_html']; ?></option>
<?php }elseif ($template_hook=='8'){ ?>
<?php if ($block_file_name == $info['block_file']){ ?>
						<option value="<?php echo $block_file_name; ?>" selected><?php echo $block_file_name; ?></option>
<?php }else{ ?>
						<option value="<?php echo $block_file_name; ?>"><?php echo $block_file_name; ?></option>
<?php } ?>
<?php }elseif ($template_hook=='9'){ ?>
					</select>
				</div>
				
				<br /><br />
				
				<div class="f_right" style="width: 30%">&nbsp;</div>
				<div class="f_right" style="width: 70%"><br /><input type="submit" class="img-submit" value="<?php echo $lang['button_submit']; ?>" /></div>
				
				</form>
			
			</td>
		</tr>
		
	</table>

	<table class="forum-index-forum-footer" cellpadding="0" cellspacing="0">
		<tr><td class="forum-index-forum-footer-contents"> </td></tr>
	</table>
<?php }elseif ($template_hook=='end'){ ?>
<?php } ?>